{volist name="data" id="vo"}
<div class="Collect am-cf">
    <a href="{:url('shop/index',array('id'=>$vo['id']))}">
        <div class="img am-fl">
            <img src="{$vo.shop_image}" alt="">
        </div>
        <div class="text am-fl">
            <p class="p1">{$vo.name}</p>
            <p class="p2 xingNum" data-index="{$vo.average}">
                <img src="/map/images/xing.png" alt="">
                <img src="/map/images/xing.png" alt="">
                <img src="/map/images/xing.png" alt="">
                <img src="/map/images/xing.png" alt="">
                <img src="/map/images/xing.png" alt="">
            </p>
            <p class="p3">
                {volist name="vo['get_shop_by_tag']" id="tags_vo"}
                <span>{$tags_vo.tagname}</span>
                {/volist}
            </p>
            <p class="p4">{$vo.length}km</p>
            <!--<p class="p5">买一送一</p>-->
        </div>
    </a>
</div>
{/volist}

<script>
    $('.xingNum').each(function(){
        let that = $(this)
        let index = that.attr('data-index')
        let img = that.find('img')
        let xing='/map/images/xing.png'
        let xing_x='/map/images/xing_x.png'
        img.each(function(i){
            if(i<index){
                $(this).attr('src',xing_x)
            }else{
                $(this).attr('src',xing)
            }
        })
    })
</script>